from multiprocessing import Process,Queue


def consumer(q):
    with open("alpha.txt", "w") as f:
        while True:
            if not q.empty():
        #with open("alpha.txt", "w") as f:
                f.write(q.get().upper()+"\n")
            else:
                break


def producer(q):
    with open("alpha.txt","r") as f:
        for res in f.readlines():
            q.put(res.strip())

if __name__ == "__main__":
    q = Queue()

    p1 = Process(target=producer,args = (q,))
    p2 = Process(target=consumer,args=(q,))

    p1.start()
    p2.start()
